<!--
  #%L
  thinkbig-ui-feed-manager
  %%
  Copyright (C) 2017 ThinkBig Analytics
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  
      http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  #L%
  -->
<div  flex style="width:100%" >

    <div flex class="md-padding feed-templates" layout-align="start center" ng-if="vm.model.totalSteps == null">
        <div>
            <div layout="column" flex layout-fill layout-align="center center">
                <div class="item-title">选择模板 <span ng-if="vm.allowImport">或者 <a href="" ng-click="vm.gotoImportFeed()">导入</a> 从文件</span></div>
            </div>
        </div>

        <br>  <br>
        <div layout="row" flex layout-fill layout-align="center center" ng-if="vm.layout == 'first'">

        <md-card style="width:420px;max-width:420px;max-height:141px;height:141px" ng-repeat="template in vm.firstTemplates track by $index" flex="initial" flex-md="initial" flex-sm="50" ng-click="vm.selectTemplate(template)">
            <md-card-title>
                <md-card-title-text>
                    <span style="font-size: 16px;font-weight:400;letter-spacing: .005em;">{{template.templateName}}</span>
                    <span class="md-subhead" style="word-wrap:break-word;">{{template.description | characters:100}}</span>
                </md-card-title-text>
                <md-card-title-media>
                    <ng-md-icon icon="{{template.icon}}" size="40" ng-style="{'fill':template.iconColor}" style="margin-right:-20px;" class="md-media-xs"></ng-md-icon>
                </md-card-title-media>
            </md-card-title>
        </md-card>
            <div>
          <a href="" ng-click="vm.more()" ng-if="vm.displayMoreLink">更多</a>
            </div>
        </div>

        <div layout="row" flex class="md-padding feed-templates" layout-align="start start"  layout-wrap ng-if="vm.layout == 'all'">
            <md-card style="width:400px;max-width:400px;max-height:121px;height:121px" ng-repeat="template in vm.allTemplates track by $index" flex="initial" flex-md="initial" flex-sm="50" ng-click="vm.selectTemplate(template)">
                <md-card-title>
                    <md-card-title-text>
                        <span style="font-size: 16px;font-weight:400;letter-spacing: .005em;">{{template.templateName}}</span>
                      <span class="md-subhead" style="word-wrap:break-word;">{{template.description | characters:100}}</span>
                    </md-card-title-text>
                    <md-card-title-media>
                        <ng-md-icon icon="{{template.icon}}" size="40" ng-style="{'fill':template.iconColor}" style="margin-right:-20px;" class="md-media-xs"></ng-md-icon>
                    </md-card-title-media>
                </md-card-title>
            </md-card>

        </div>

    </div>

    <thinkbig-stepper total-steps="{{vm.model.totalSteps}}" stepper-name="DefineFeedStepper" core-data-model="vm.model" on-initialized="vm.onStepperInitialized" on-cancel-stepper="vm.cancelStepper()"
                      template-url="js/feed-mgr/feeds/define-feed/define-feed-stepper.html" ng-if="vm.model.totalSteps != null"></thinkbig-stepper>

</div>
